package cn.hwh.springframework.beans.factory.support;

import cn.hwh.springframework.beans.BeansException;
import cn.hwh.springframework.core.io.DefaultResourceLoader;
import cn.hwh.springframework.core.io.Resource;
import cn.hwh.springframework.core.io.ResourceLoader;

/**
 * @author wenhao hu
 * @title: AbstractBeanDefinitionReader
 * @projectName mini-spring
 * @description: TODO
 * @date 2022/1/2514:30
 */
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader{

    private final BeanDefinitionRegistry registry;

    private ResourceLoader resourceLoader;

    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry){
        this(registry,new DefaultResourceLoader());
    }

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry,ResourceLoader resourceLoader){
        this.registry = registry;
        this.resourceLoader = resourceLoader;
    }

    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }
}
